package com.pet.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 宠物捐赠信息表
 * @TableName pet_donation
 */
@TableName(value ="pet_donation")
@Data
public class PetDonation implements Serializable {
    /**
     * 捐赠人id
     */
    @TableId(value = "donator_id", type = IdType.AUTO)
    private Integer donator_id;

    /**
     * 捐赠人名字
     */
    @TableField(value = "donator_name")
    private String donator_name;

    /**
     * 捐赠人的捐赠物
     */
    @TableField(value = "donator_supplies")
    private String donator_supplies;

    /**
     * 捐赠时间
     */
    @TableField(value = "donator_date")
    private LocalDateTime donator_date;

    /**
     * 删除状态：0未删除，1已删除
     */
    @TableField(value = "is_delete")
    private Integer is_delete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PetDonation other = (PetDonation) that;
        return (this.getDonator_id() == null ? other.getDonator_id() == null : this.getDonator_id().equals(other.getDonator_id()))
            && (this.getDonator_name() == null ? other.getDonator_name() == null : this.getDonator_name().equals(other.getDonator_name()))
            && (this.getDonator_supplies() == null ? other.getDonator_supplies() == null : this.getDonator_supplies().equals(other.getDonator_supplies()))
            && (this.getDonator_date() == null ? other.getDonator_date() == null : this.getDonator_date().equals(other.getDonator_date()))
            && (this.getIs_delete() == null ? other.getIs_delete() == null : this.getIs_delete().equals(other.getIs_delete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDonator_id() == null) ? 0 : getDonator_id().hashCode());
        result = prime * result + ((getDonator_name() == null) ? 0 : getDonator_name().hashCode());
        result = prime * result + ((getDonator_supplies() == null) ? 0 : getDonator_supplies().hashCode());
        result = prime * result + ((getDonator_date() == null) ? 0 : getDonator_date().hashCode());
        result = prime * result + ((getIs_delete() == null) ? 0 : getIs_delete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", donator_id=").append(donator_id);
        sb.append(", donator_name=").append(donator_name);
        sb.append(", donator_supplies=").append(donator_supplies);
        sb.append(", donator_date=").append(donator_date);
        sb.append(", is_delete=").append(is_delete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}